<div class="modal-header">
    <h3 class="modal-title">{{type}} New User</h3>
</div>
<form name="form" class="form-validation">
<div class="modal-body">
    <div class="form-group pull-in clearfix">
		<div class="col-sm-6">
	    	<label>Code</label>
	        <input type="text" class="form-control zn-font" name="userCode" ng-model="user.userCode" ng-pattern="/^[a-zA-Z0-9]{4,10}$/" ng-required="true" 
	        		ui-validate="{unique : 'url($value, 4)'}" ui-validate-url="/entity/user/">
	        <span ng-show='!form.userCode.$error.pattern && form.userCode.$error.unique && !form.userCode.$pristine' class="text-danger-dk">Usercode already existed!</span>
	    </div>
	    <div class="col-sm-6">
	        <label>Name</label>
	        <input type="text" class="form-control zn-font" name="userName" ng-model="user.userName" ng-minlength="2" ng-maxlength="10" required>
	    </div>
	</div>   
	<div class="form-group pull-in clearfix">
		<div class="col-sm-6">
	    	<label>Moblie</label>
	        <input type="text" class="form-control zn-font" name="userMobile" ng-model="user.userMobile" placeholder="1XXXXXXXXXX" ng-pattern="/1[0-9]{10}$/" required>  
	    </div>
	    <div class="col-sm-6">
	        <label>Organization</label>
          	<select name="userOrgId" class="form-control m-b zn-font" ng-model="user.userOrgId" >         		
          		<option value='{{org.orgId}}' ng-repeat="org in orglist">{{org.orgName}}</option>
          	</select>
	    </div>
	</div>     
	<div class="form-group">
		<label>Sign <em class="text-muted">(no more than 50 char)</em></label>
	  	<input type="text" name="userSign" class="form-control zn-font" ng-model="user.userSign" ng-maxlength="50"  required>
	</div>	                                  
	<div class="checkbox m-t-md">
		<label class="i-checks">
	    	<input type="checkbox" id="userRole" value="2" ng-model="user.userRole"><i></i> He or she is a &nbsp;<a class="text-info">Administrator</a>
	    </label>
	</div>
</div>
</form>
<div class="modal-footer">                  
    <button class="btn btn-default" ng-click="cancel()">Cancel</button>
    <button class="btn btn-primary" ng-click="ok()" ng-disabled="form.$invalid">OK</button>
</div>
